---
category: Validator
created: '2020-06-05'
title: Check if a value is a string
updated: '2021-10-13'
---

**JavaScript version**

```js isString.js
const isString = (value) => Object.prototype.toString.call(value) === '[object String]';
```

**TypeScript version**

```ts isString.ts
const isString = (value: any): boolean => Object.prototype.toString.call(value) === '[object String]';
```

**Examples**

```js examples.js
isString('hello world'); // true
isString(new String('hello world')); // true
isString(10); // false
```
